package com.xingfly.repository;

import com.xingfly.model.Relation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by SuperS on 2016/12/7.
 */
public interface RelationRepository extends JpaRepository<Relation, Long> {
    @Query("SELECT r FROM Relation r WHERE r.tag.id=:id")
    List<Relation> findRelationsByTagId(@Param("id") Long tagId);
}
